﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Windows.Forms;

using STAR.RunnerFramework;

namespace TestHelper
{
    public partial class TestHelperForm : Form
    {
        public TestHelperForm()
        {
            InitializeComponent();
        }

        private void getInfo_Click(object sender, EventArgs e)
        {
            STAR.RunnerFramework.TestHelper helper;

            helper = new STAR.RunnerFramework.TestHelper();
            Process[] processes = Process.GetProcessesByName(this.processName.Text);
        
            if( processes != null && processes.Length > 0)
            {
                helper.SetUp(processes[0]);
                DataTable newTable = helper.GetControlTable();
                this.controlGridView.DataSource = newTable;
            }

        }
    }
}
